\(\int (c+d x) (a+b \coth (e+f x)) \, dx\) [39]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 16, antiderivative size = 75 \[ \int (c+d x) (a+b \coth (e+f x)) \, dx=\frac {a (c+d x)^2}{2 d}-\frac {b (c+d x)^2}{2 d}+\frac {b (c+d x) \log \left (1-e^{2 (e+f x)}\right )}{f}+\frac {b d \operatorname {PolyLog}\left (2,e^{2 (e+f x)}\right )}{2 f^2} \]

[Out]

1/2*a*(d*x+c)^2/d-1/2*b*(d*x+c)^2/d+b*(d*x+c)*ln(1-exp(2*f*x+2*e))/f+1/2*b*d*polylog(2,exp(2*f*x+2*e))/f^2

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {3803, 3797, 2221, 2317, 2438} \[ \int (c+d x) (a+b \coth (e+f x)) \, dx=\frac {a (c+d x)^2}{2 d}+\frac {b (c+d x) \log \left (1-e^{2 (e+f x)}\right )}{f}-\frac {b (c+d x)^2}{2 d}+\frac {b d \operatorname {PolyLog}\left (2,e^{2 (e+f x)}\right )}{2 f^2} \]

[In]

Int[(c + d*x)*(a + b*Coth[e + f*x]),x]

[Out]

(a*(c + d*x)^2)/(2*d) - (b*(c + d*x)^2)/(2*d) + (b*(c + d*x)*Log[1 - E^(2*(e + f*x))])/f + (b*d*PolyLog[2, E^(
2*(e + f*x))])/(2*f^2)

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 3797

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (Complex[0, fz_])*(f_.)*(x_)], x_Symbol] :> Simp[(-I)*((
c + d*x)^(m + 1)/(d*(m + 1))), x] + Dist[2*I, Int[((c + d*x)^m*(E^(2*((-I)*e + f*fz*x))/(1 + E^(2*((-I)*e + f*
fz*x))/E^(2*I*k*Pi))))/E^(2*I*k*Pi), x], x] /; FreeQ[{c, d, e, f, fz}, x] && IntegerQ[4*k] && IGtQ[m, 0]

Rule 3803

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Tan[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]

Rubi steps \begin{align*} \text {integral}& = \int (a (c+d x)+b (c+d x) \coth (e+f x)) \, dx \\ & = \frac {a (c+d x)^2}{2 d}+b \int (c+d x) \coth (e+f x) \, dx \\ & = \frac {a (c+d x)^2}{2 d}-\frac {b (c+d x)^2}{2 d}-(2 b) \int \frac {e^{2 (e+f x)} (c+d x)}{1-e^{2 (e+f x)}} \, dx \\ & = \frac {a (c+d x)^2}{2 d}-\frac {b (c+d x)^2}{2 d}+\frac {b (c+d x) \log \left (1-e^{2 (e+f x)}\right )}{f}-\frac {(b d) \int \log \left (1-e^{2 (e+f x)}\right ) \, dx}{f} \\ & = \frac {a (c+d x)^2}{2 d}-\frac {b (c+d x)^2}{2 d}+\frac {b (c+d x) \log \left (1-e^{2 (e+f x)}\right )}{f}-\frac {(b d) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{2 (e+f x)}\right )}{2 f^2} \\ & = \frac {a (c+d x)^2}{2 d}-\frac {b (c+d x)^2}{2 d}+\frac {b (c+d x) \log \left (1-e^{2 (e+f x)}\right )}{f}+\frac {b d \operatorname {PolyLog}\left (2,e^{2 (e+f x)}\right )}{2 f^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.16 \[ \int (c+d x) (a+b \coth (e+f x)) \, dx=a c x+\frac {1}{2} a d x^2-\frac {1}{2} b d x^2+\frac {b d x \log \left (1-e^{2 e+2 f x}\right )}{f}+\frac {b c (\log (\cosh (e+f x))+\log (\tanh (e+f x)))}{f}+\frac {b d \operatorname {PolyLog}\left (2,e^{2 e+2 f x}\right )}{2 f^2} \]

[In]

Integrate[(c + d*x)*(a + b*Coth[e + f*x]),x]

[Out]

a*c*x + (a*d*x^2)/2 - (b*d*x^2)/2 + (b*d*x*Log[1 - E^(2*e + 2*f*x)])/f + (b*c*(Log[Cosh[e + f*x]] + Log[Tanh[e
 + f*x]]))/f + (b*d*PolyLog[2, E^(2*e + 2*f*x)])/(2*f^2)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(200\) vs. \(2(69)=138\).

Time = 0.19 (sec) , antiderivative size = 201, normalized size of antiderivative = 2.68

method result size
risch \(\frac {a d \,x^{2}}{2}+a c x -\frac {b d \,x^{2}}{2}+b c x +\frac {b c \ln \left ({\mathrm e}^{f x +e}-1\right )}{f}+\frac {b c \ln \left (1+{\mathrm e}^{f x +e}\right )}{f}-\frac {2 b c \ln \left ({\mathrm e}^{f x +e}\right )}{f}-\frac {2 b d e x}{f}-\frac {b d \,e^{2}}{f^{2}}+\frac {b d \ln \left (1-{\mathrm e}^{f x +e}\right ) x}{f}+\frac {b d \ln \left (1-{\mathrm e}^{f x +e}\right ) e}{f^{2}}+\frac {b d \operatorname {polylog}\left (2, {\mathrm e}^{f x +e}\right )}{f^{2}}+\frac {b d \ln \left (1+{\mathrm e}^{f x +e}\right ) x}{f}+\frac {b d \operatorname {polylog}\left (2, -{\mathrm e}^{f x +e}\right )}{f^{2}}-\frac {b d e \ln \left ({\mathrm e}^{f x +e}-1\right )}{f^{2}}+\frac {2 b d e \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2}}\) \(201\)

[In]

int((d*x+c)*(a+b*coth(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/2*a*d*x^2+a*c*x-1/2*b*d*x^2+b*c*x+1/f*b*c*ln(exp(f*x+e)-1)+1/f*b*c*ln(1+exp(f*x+e))-2/f*b*c*ln(exp(f*x+e))-2
/f*b*d*e*x-1/f^2*b*d*e^2+1/f*b*d*ln(1-exp(f*x+e))*x+1/f^2*b*d*ln(1-exp(f*x+e))*e+1/f^2*b*d*polylog(2,exp(f*x+e
))+1/f*b*d*ln(1+exp(f*x+e))*x+1/f^2*b*d*polylog(2,-exp(f*x+e))-1/f^2*b*d*e*ln(exp(f*x+e)-1)+2/f^2*b*d*e*ln(exp
(f*x+e))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 156 vs. \(2 (68) = 136\).

Time = 0.26 (sec) , antiderivative size = 156, normalized size of antiderivative = 2.08 \[ \int (c+d x) (a+b \coth (e+f x)) \, dx=\frac {{\left (a - b\right )} d f^{2} x^{2} + 2 \, {\left (a - b\right )} c f^{2} x + 2 \, b d {\rm Li}_2\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right ) + 2 \, b d {\rm Li}_2\left (-\cosh \left (f x + e\right ) - \sinh \left (f x + e\right )\right ) + 2 \, {\left (b d f x + b c f\right )} \log \left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right ) + 1\right ) - 2 \, {\left (b d e - b c f\right )} \log \left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right ) - 1\right ) + 2 \, {\left (b d f x + b d e\right )} \log \left (-\cosh \left (f x + e\right ) - \sinh \left (f x + e\right ) + 1\right )}{2 \, f^{2}} \]

[In]

integrate((d*x+c)*(a+b*coth(f*x+e)),x, algorithm="fricas")

[Out]

1/2*((a - b)*d*f^2*x^2 + 2*(a - b)*c*f^2*x + 2*b*d*dilog(cosh(f*x + e) + sinh(f*x + e)) + 2*b*d*dilog(-cosh(f*
x + e) - sinh(f*x + e)) + 2*(b*d*f*x + b*c*f)*log(cosh(f*x + e) + sinh(f*x + e) + 1) - 2*(b*d*e - b*c*f)*log(c
osh(f*x + e) + sinh(f*x + e) - 1) + 2*(b*d*f*x + b*d*e)*log(-cosh(f*x + e) - sinh(f*x + e) + 1))/f^2

Sympy [F]

\[ \int (c+d x) (a+b \coth (e+f x)) \, dx=\int \left (a + b \coth {\left (e + f x \right )}\right ) \left (c + d x\right )\, dx \]

[In]

integrate((d*x+c)*(a+b*coth(f*x+e)),x)

[Out]

Integral((a + b*coth(e + f*x))*(c + d*x), x)

Maxima [F]

\[ \int (c+d x) (a+b \coth (e+f x)) \, dx=\int { {\left (d x + c\right )} {\left (b \coth \left (f x + e\right ) + a\right )} \,d x } \]

[In]

integrate((d*x+c)*(a+b*coth(f*x+e)),x, algorithm="maxima")

[Out]

1/2*a*d*x^2 + 1/2*(x^2 - 2*integrate(x/(e^(f*x + e) + 1), x) + 2*integrate(x/(e^(f*x + e) - 1), x))*b*d + a*c*
x + b*c*log(sinh(f*x + e))/f

Giac [F]

\[ \int (c+d x) (a+b \coth (e+f x)) \, dx=\int { {\left (d x + c\right )} {\left (b \coth \left (f x + e\right ) + a\right )} \,d x } \]

[In]

integrate((d*x+c)*(a+b*coth(f*x+e)),x, algorithm="giac")

[Out]

integrate((d*x + c)*(b*coth(f*x + e) + a), x)

Mupad [F(-1)]

Timed out. \[ \int (c+d x) (a+b \coth (e+f x)) \, dx=\int \left (a+b\,\mathrm {coth}\left (e+f\,x\right )\right )\,\left (c+d\,x\right ) \,d x \]

[In]

int((a + b*coth(e + f*x))*(c + d*x),x)

[Out]

int((a + b*coth(e + f*x))*(c + d*x), x)